<%@page import="java.util.Iterator"%>
<%@page import="com.pks.autoInsurance.dto.CustomerDto"%>
<html>
<head>
<jsp:include page="header.jsp" />
<title>AutoInsurance - Users Administration</title>
<script type="text/javascript" src="template/js/page/adminManage.js"></script>
<link href="template/css/icon.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div id="content-box">
		<div class="border">
			<div class="padding">
				<div id="toolbar-box">
					<div class="t">
						<div class="t">
							<div class="t"></div>
						</div>
					</div>
					<div class="m">
						<div class="toolbar" id="toolbar"></div>
						<div class="header icon-48-user">User Manager</div>

						<div class="clr"></div>
					</div>
					<div class="b">
						<div class="b">
							<div class="b"></div>
						</div>
					</div>
				</div>
				<div class="clr"></div>

				<%
					if (request.getAttribute("message") != null) {
				%>
				<dl id="system-message">
					<dt class="message">Message</dt>
					<dd class="message message fade">
						<ul>
							<li><%=request.getAttribute("message")%></li>
						</ul>
					</dd>
				</dl>
				<%
					}
				%>
				<div id="element-box">
					<div class="t">
						<div class="t">
							<div class="t"></div>
						</div>
					</div>
					<div class="m">



						<form action="admin" method="post" name="adminForm">
							<table>
								<tbody>
									<tr>
										<td width="100%">Filter: <input name="ssn"
											onchange="document.adminForm.submit();" type="text">
											<input type="submit" value="Search" /> <input type="reset"
											value="Reset" /> <input type="hidden" name="task"
											value="search-user" />
										</td>
									</tr>
								</tbody>
							</table>
						</form>
						<form action="admin" method="post" name="personForm">
							<input type="hidden" name="task" value="edit-user" /> <input
								type="hidden" name="ssn" />
							<table class="adminlist" cellpadding="1">
								<thead>
									<tr>
										<th class="title" width="15%">SSN</th>
										<th class="title">First Name</th>
										<th class="title">Last Name</th>
										<th class="title">Group</th>
										<th class="title">Contact No</th>
										<th class="title">City</th>
										<th class="title">Gender</th>
										<th class="title">E-Mail</th>
										<th class="title">Action</th>
									</tr>
								</thead>
								<tbody>
									<%
										java.util.List<CustomerDto> registrationDtos = (java.util.List<CustomerDto>) request
																			.getAttribute("registrationDtos");
																	if (registrationDtos != null) {
																		for (CustomerDto registrationDto : registrationDtos) {
									%>
									<tr class="row0" id="<%=registrationDto.getSsn()%>">
										<td><span><%=registrationDto.getSsn()%></span>
										</td>
										<td><%=registrationDto.getFirstName()%></td>
										<td><%=registrationDto.getLastName()%></td>
										<td>
											<%
												if ("adminadmin".equals(registrationDto.getSsn()))
															out.println("Administrator");
														else
															out.println("User");
											%>
										</td>
										<td><%=registrationDto.getMobileNo()%></td>
										<td><%=registrationDto.getCity()%></td>
										<td><%=registrationDto.getGender()%></td>
										<td><%=registrationDto.getEmail()%></td>
										<td><a onclick="del(this);">Delete</a></td>
									</tr>
									<%
										}
										}
									%>
								</tbody>
							</table>
						</form>


						<div class="clr"></div>
					</div>
					<div class="b">
						<div class="b">
							<div class="b"></div>
						</div>
					</div>
				</div>
				<jsp:include page="footer.jsp" />
			</div>
		</div>
	</div>
</body>
</html>